// import xtxSkeleton from '@/golbalComponents/xtxSkeleton'
// import xtxCarousel from '@/golbalComponents/xtxCarousel'
// import xtxMore from '@/golbalComponents/xtxMore'
// import xtxBread from '@/golbalComponents/xtxBread'
// import xtxBreadItem from '@/golbalComponents/xtxBreadItem'
// import xtxCheckbox from '@/golbalComponents/xtxCheckbox'
// import xtxList from '@/golbalComponents/xtxList'

//全局自定义指令文件
import directives from '@/directives/directives'

export default {
  install (app) {
    //  注册所有的全局自定义指令
    Object.keys(directives).forEach(key => {
      app.directive(key, directives[key])
    })

    //注册所有的全局组件
    const comFn = require.context('@/golbalComponents', false, /\.vue$/)
    // 遍历所有的路径并注册组件
    comFn.keys().forEach(path => {
      const instance = comFn(path).default || comFn(path)
      app.component(instance.name, instance)
    })

    //导入所有全局组件
    // app.component(xtxSkeleton.name,xtxSkeleton)
    // app.component(xtxCarousel.name,xtxCarousel)
    // app.component(xtxMore.name,xtxMore)
    // app.component(xtxBread.name,xtxBread)
    // app.component(xtxBreadItem.name,xtxBreadItem)
    // app.component(xtxCheckbox.name,xtxCheckbox)
    // app.component(xtxList.name,xtxList)
  }
}
